﻿#region Copyright 
/*-------------------------------------------------------------------------
* 命名空间名称/文件名:    SSPivot.Admin.Core.Service.sys.User/ISysUserService 
* CLR版本:     4.0.30319.42000
* 机器名称:    DESKTOP-NHMLO8A
* 功 能：       N/A
* 类 名：       ISysUserService
* 创建时间：  2025/6/4 16:12:40
* 版本号：      v1.0
* 创建人:        xulong
*-------------------------------------------------------------------------*/
#endregion 
using SSPivot.Admin.Core.Service.communal.Account.Dto;
using SSPivot.Admin.Core.Service.Dto;
using SSPivot.Admin.Core.Service.sys.User.Dto;
using SSPivot.AspNetCore.Abstractions.User;
using SSPivot.AspNetCore.Services;
using SSPivot.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SSPivot.Admin.Core.Service.sys.User
{
    /// <summary>
    /// 用户服务
    /// </summary>
    public interface ISysUserService : IApplicationService
    {
        #region 服务

        /// <summary>
        /// 查询用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<UserGetDto> GetAsync(long id);

        /// <summary>
        /// 查询分页
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>   
        Task<(List<UserGetPageDto>, PageResult)> QueryPageAsync(QuerySysUserRequset model, PageResult page);

        /// <summary>
        /// 查询登录用户信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns> 
        Task<AuthLoginResultDto> GetLoginUserAsync(long id);

        /// <summary>
        /// 获得数据权限
        /// </summary>
        /// <param name="apiPath"></param>
        /// <returns></returns> 
        Task<DataPermissionDto> GetDataPermissionAsync(string? apiPath);

        /// <summary>
        /// 查询用户基本信息
        /// </summary>
        /// <returns></returns> 
        Task<UserGetBasicDto> GetBasicAsync();

        /// <summary>
        /// 查询用户权限信息
        /// </summary>
        /// <returns></returns>
        Task<UserPermissionDto> GetPermissionAsync();

        /// <summary>
        /// 新增用户
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<long> AddAsync(SysUserAddDto model);
        /// <summary>
        /// 修改用户
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns> 
        Task UpdateAsync(SysUserAddDto model);

        /// <summary>
        /// 新增会员
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<long> AddMemberAsync(SysUserAddMemberDto model);

        /// <summary>
        /// 修改会员
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns> 
        Task UpdateMemberAsync(SysUserAddMemberDto model);

        /// <summary>
        /// 更新用户基本信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns> 
        Task UpdateBasicAsync(SysUserUpdateBasicDto model);

        /// <summary>
        /// 修改用户密码
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns> 
        Task ChangePasswordAsync(SysUserChangePasswordDto model);

        /// <summary>
        /// 重置密码
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<string> ResetPasswordAsync(UserResetPasswordDto model);

        /// <summary>
        /// 设置主管
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task SetManagerAsync(UserSetManagerDto model);
        /// <summary>
        /// 设置启用
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task SetEnableAsync(SetEnabledDto model);

        /// <summary>
        /// 批量设置部门
        /// </summary>
        /// <returns></returns> 
        Task BatchSetOrgAsync(UserBatchSetOrgDto model);

        /// <summary>
        /// 彻底删除用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns> 
        Task DeleteAsync(long id);

        /// <summary>
        /// 批量彻底删除用户
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns> 
        Task BatchDeleteAsync(long[] ids);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task SoftDeleteAsync(long id);

        /// <summary>
        /// 批量删除用户
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns> 
        Task BatchSoftDeleteAsync(long[] ids);

        /// <summary>
        /// 上传头像
        /// </summary>
        /// <param name="file"></param>
        /// <param name="autoUpdate"></param>
        /// <returns></returns> 
        Task UpdateAvatar(SetStringDto model);
        /// <summary>
        /// 一键登录用户
        /// </summary>
        /// <returns></returns> 
        Task<dynamic> OneClickLoginAsync(string account);
        /// <summary>
        /// 强制用户下线
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        void ForceOfflineAsync(long id);
        #endregion

    }
}
